<template>
	<view class="container">
		<view class="orderBox" v-for="(item,value) in list" :key="value">
			<view class="header">
				<view>开票时间：{{item.updateTime}}</view>
				<view :style="item.status==2?'color: #ff4c05;':'color: #FFBF08;'">{{item.status==0?'开票中':item.status==1?'已开票':item.status==2?'开票失败':'未知状态'}}</view>
			</view>
			<view class="bodyBox" v-if="item.warehouseRentRecordList&&item.warehouseRentRecordList[0]">
				<image :src="item.warehouseRentRecordList[0].warehouseImg" mode="aspectFill"></image>
				<view>
					<view>{{item.warehouseRentRecordList[0].warehouseName}} {{item.warehouseRentRecordList[0].warehouseNumber}}</view>
					<view style="color: #6B7280;font-size: 28rpx;margin: 12rpx 0 2rpx;">空间大小：{{item.warehouseRentRecordList[0].warehouseSize}}</view>
					<view style="color: #6B7280;font-size: 28rpx;">到期时间：{{item.warehouseRentRecordList[0].currentRentEndDate}}</view>
				</view>
			</view>
			<view style="font-size: 34rpx;color: #000000;font-weight: bold;margin: 30rpx 20rpx 30rpx auto;text-align: right;" v-if="item.orderType==1">开票金额：￥{{item.warehouseRentRecordList[0].payAmount}}</view>
			<view style="font-size: 34rpx;color: #000000;font-weight: bold;margin: 30rpx 20rpx 30rpx auto;text-align: center;" v-if="item.orderType==2">开票金额：￥{{item.orderList[0].payAmount}}</view>
			<view class="txtBox" v-if="item.orderType==2">
				<view>订单编号</view>
				<view style="color: #9EA2BB;">{{item.orderNo}}</view>
			</view>
			<view class="txtBox">
				<view>税号</view>
				<view style="color: #9EA2BB;">{{item.taxId}}</view>
			</view>
			<view class="txtBox">
				<view>公司名称</view>
				<view style="color: #9EA2BB;">{{item.invoiceTitle}}</view>
			</view>
			<view class="txtBox">
				<view>邮箱</view>
				<view style="color: #9EA2BB;">{{item.email}}</view>
			</view>
			<view class="txtBox">
				<view>电话</view>
				<view style="color: #9EA2BB;">{{item.phone}}</view>
			</view>
			<view class="txtBox" style="border: none;">
				<view>类型</view>
				<view style="color: #9EA2BB;">{{item.type==1?'个人':'企业'}}</view>
			</view>
			
		</view>
		<image class="noDataPic" src="https://xcx.daishulincun.cn/api/upload/20250917/aaad2e41-8e76-4257-8cdf-03672b3b0890.png" mode="widthFix" v-if="noDataVisible"></image>
	</view>
</template>

<script>
	// 状态 0申请中 1已完成 2开票失败
	export default {
		components: {
			
		},
		filters: {
		  
		},
		data() {
			return {
				list:[],
				noDataVisible:false,
			}
		},
		onShow() {
			this.init()
		},
		//先走onload再走onshow
		onLoad() {
			
		},
		methods: {
			init(){
				this.$http('/api/invoice/getUserInvoiceApplyList',{pageNo:1,pageSize:999}).then(res=>{
					this.list = res.result.records
					if(!this.list.length){
						this.noDataVisible = true
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.container {
	background: rgb(236, 236, 236);
	min-height: 100vh;
	padding-top: 25upx;
	box-sizing: border-box;
	padding-bottom: 100upx;
	.orderBox {
		width: 700rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		margin: 0 auto 30rpx;
		padding: 0 28rpx 20rpx;
		.header {
			height: 88rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;
			color: #000000;
			border-bottom: 1rpx solid #eaeaea;
		}
		.bodyBox {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 170rpx;
			padding-top: 40rpx;
			image {
				width: 170rpx;
				height: 120rpx;
				margin-right: 20rpx;
				min-width: 170rpx;
			}
		}
		.txtBox {
			width: 100%;
			height: 120rpx;
			padding: 0 32rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 32rpx;
			color: #252E37;
			border-bottom: 1rpx solid #efefef;
		}
	}
}
.noDataPic {
	position: fixed;
	z-index: 99;
	width: 300rpx;
	height: 0;
	top: calc(50vh - 300rpx);
	left: 225rpx;
	margin: 0 auto;
}
</style>
